package com.service.impl;

import com.dao.TestDao;
import com.pojo.User;
import com.service.TestService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author Rxiao
 * @Date 2018/08/26/0026 10:24
 * @Version: 1.0
 */
@Service
public class TestServiceImpl implements TestService {
    @Resource
    private TestDao testDao;

    @Override
    public User findUser(String id) {
        return testDao.findUser(id);
    }

    @Override
    public Map findByID(int id) {
        return testDao.findByID(id);
    }

    @Override
    public List<Map> findAll(String FName) {
        if (FName != null) {
            FName = FName.trim();
        }
        return testDao.findAll(FName);
    }

    @Override
    @Transactional
    public void delByID(int id) {
        testDao.delByID(id);
    }

    @Override
    @Transactional
    public void edit(Map map) {
        testDao.edit(map);
    }

    @Override
    public List<Map> findNianji() {
        return testDao.findNianji();
    }

    @Override
    @Transactional
    public void add(Map map) {
        testDao.add(map);
    }

    @Override
    public List<Map> findJson() {
        return testDao.findJson();
    }
}
